﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/Admin.Master" AutoEventWireup="true" CodeBehind="AlbumCreate.aspx.cs" Inherits="mamnontuoitho7.backend.AlbumCreate"  ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminTitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript" type="text/javascript">
    function Validation() {
        var title = trim(document.getElementById("<%= txtTitleName.ClientID %>").value);
        var photo = trim(document.getElementById("<%= fulPhoto.ClientID %>").value);

        var leng = title.length;
        if (leng ==0 || leng > 500) {
            alert("Tên album dài hơn 1 ký tự và không quá 500 ký tự");
            return false;
        }
       
        if (photo.length == 0 ) {
            alert("Hình ảnh chủ đề không được để trống");
            return false;
        }
    }
    function trim(str) {
        return str.replace(/^\s+|\s+$/g, "");
    }
    </script>
<form id="form1" runat="server">
    <!-- Begin one column tab content window -->
    <div class="onecolumn">
	    <div class="header">
		    <span>Thêm Mới Album Ảnh</span>
		    <div class="switchbutton">
                  <a href="AlbumList.aspx" class="buttons stylebutton">Danh sách</a>
		    </div>
	    </div>
	    <br class="clear"/>
	    <div class="content">
		    <div id="tab2_content" class="tab_content">
                <div class="tableform">
                    <div>
                        <div class="left">
                            Tên album ảnh:<br />
                            <asp:TextBox ID="txtTitleName" runat="server" style="width:340px"></asp:TextBox>
                        </div>
                        <div class="right">
                            Hình ảnh chủ đề:<br />
                            <asp:FileUpload ID="fulPhoto" runat="server" style="width:346px;"/>
                        </div>
                    </div><br class="clear"/><br />
                    <div>
                        Mô tả Album:<br />
                        <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" style="width:750px; min-height:100px;"></asp:TextBox></div><br />
                    <p>
				        <asp:Button ID="btnAlbumCreate" runat="server" Text="Lưu" 
                            onclick="btnAlbumCreate_Click" OnClientClick="return Validation()"/>
                            <asp:Label ID="lblNotice" runat="server" 
                                ForeColor="Red" Font-Bold="True" Font-Size="Medium"></asp:Label>
                        </p>
                </div>
	  		    <br class="clear"/>
		    </div>
	    </div>
    </div>
    <!-- End one column tab content window -->
</form>
</asp:Content>
